﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GuanQL.Core.Extensions
{
    public static class ByteArrayExtension
    {
        public static string BytesToHexString(this byte[] bytes)
        {
            var result = "";
            foreach (byte b in bytes)
            {
                result += " " + b.ToString("X").PadLeft(2, '0');
            }
            if (result.Length > 0) result = result.Substring(1);
            return result;
        }
    }
}
